﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Security;

namespace WebMVC.Areas.AdminPanel.Controllers
{
    //[Authorize(Roles="admin")]
    public class AdminControllerBase : Controller
    {
        protected string Info
        {
            set
            {
                TempData["info"] = value;
            }
        }

        protected string Error
        {
            set
            {
                TempData["error"] = value;
            }
        }

        protected Guid? CurrentUserId
        {
            get
            {
                if (HttpContext.User.Identity.IsAuthenticated)
                {
                    return new Guid(Membership.GetUser().ProviderUserKey.ToString());
                }
                else
                {
                    return null;
                }
            }
        }
    }
}
